#include <iostream>
#include <cstring>
#include <cstdlib>

using namespace std;

int a[26];

bool canConstruct(string ransomNote, string magazine){
    memset(a,0,sizeof(a));
    for(int i=0;i<magazine.length();i++){
        a[magazine[i]-'a']++;
    }
    for(int i=0;i<ransomNote.length();i++){
        if(a[ransomNote[i]-'a']==0){
            return false;
        }
        else{
            a[ransomNote[i]-'a']--;
        }
    }
    return true;
}

int main()
{
    string a,b;
    cin>>a>>b;
    if(canConstruct(a,b)){
        cout<<"true"<<endl;
    }
    else{
        cout<<"false"<<endl;
    }
    return 0;
}